<script setup lang="ts">
import ChannelNav from './components/ChannelNav.vue';
import ArticleList from './components/ArticleList.vue'
import { ref } from 'vue';

// //默认频道id:0为推荐
// //父组件定义的默认值channelId,传递给子组件
// const channelId=ref(0)

// //接收到了一个Id值
// const updataChannelId=(id:number)=>{
//   channelId.value=id
// }
</script>
<!-- 1,父传子 -->
<!-- 将默认值父组件的channelId传给子组件用来接收的channelId -->
 <!-- 2 ,子传父-->
  <!-- 将子组件回传过来的 updata:channe-id用@接收一下,里面回调函数,
   一个用来接收，一个用来告诉父组件重新渲染-->
  
<template>

  <!-- <ChannelNav :channel-id="channelId" @updata:channe-id="(id:number)=>{channelId=id}"></ChannelNav>
  <ArticleList :channel-id="channelId"></ArticleList> -->
  <ChannelNav ></ChannelNav>
  <ArticleList ></ArticleList>


  <!-- 路由视口 -->
  <router-view />
</template>
<style scoped>

</style>